[bits 32]

[global read_cr0]
read_cr0:
     mov eax,cr0
     retn
     
[global write_cr0]
write_cr0:
     push ebp
     mov ebp,esp
     mov eax,[ebp+8]
     mov cr0,eax
     pop ebp
     retn

[global _read_cr3]
_read_cr3:
     mov eax,cr3
     retn

[global write_cr3]
write_cr3:
     push ebp
     mov ebp,esp
     mov eax,[ebp+8]
     mov cr3,eax
     pop ebp
     retn
     
[global enable_paging]
enable_paging:
     mov eax,cr0
     or eax,0x80000000
     mov cr0,eax
     jmp .5
.5:
     retn          
